package 金卡银卡Bigdecimal_多态;

import java.math.BigDecimal;

public abstract class Card {
    //车牌号码、
    //电话号码
    // 卡片余额
    // 车主姓名
    public static final String PLATE_NUMBER = "车牌号码";
    public static final String PHONE_NUMBER = "电话号码";
    public static final String BALANCE = "卡片余额";
    public static final String THE_NAME_OF_THE_OWNER="车主姓名" ;
    public static final String DISCOUNT_GOLD="0.8";
    public static final String SPEND_200_OR_MORE0="200";
    public String plateNumber;
    public String phoneNumber;
    public BigDecimal balance;
    public String theNameOfTheOwner;

    public abstract void payment(BigDecimal money);
    //无参构造方法
    public Card() {
    }

    //有参构造方法
    public Card(String plateNumber, String phoneNumber, BigDecimal balance, String theNameOfTheOwner) {
        this.plateNumber = plateNumber;
        this.phoneNumber = phoneNumber;
        this.balance = balance;
        this.theNameOfTheOwner = theNameOfTheOwner;
    }

    //获取车牌号码
    public String getPlateNumber() {
        return plateNumber;
    }

    //设置车牌号码
    public void setPlateNumber(String plateNumber) {
        this.plateNumber = plateNumber;
    }

    //获取电话号码
    public String getPhoneNumber() {
        return phoneNumber;
    }

    //设置电话号码
    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    //获取卡片余额
    public BigDecimal getBalance() {
        return balance;
    }

    //设置卡片余额
    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    //获取车主姓名
    public String getTheNameOfTheOwner() {
        return theNameOfTheOwner;
    }

    //设置车主姓名
    public void setTheNameOfTheOwner(String theNameOfTheOwner) {
        this.theNameOfTheOwner = theNameOfTheOwner;
    }

    //重写toString方法
    @Override
    public String toString() {
        return "Card{" +
                "plateNumber='" + plateNumber + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", balance=" + balance +
                ", theNameOfTheOwner='" + theNameOfTheOwner + '\'' +
                '}';
    }
}
